  <body>
    <form method="POST" action="action.php">
    <div>
        <table class="input">
        <td><?php echo $scenario; ?></td></tr>
        <td><?php echo 'Application Version: '.$aDatasetFile['application']; ?></td></tr>
        <td><?php echo 'Schema Version: '.$aDatasetFile['version']; ?></td></tr>
        <td><?php echo 'Database Name: '. $aDatasetFile['name']; ?></td></tr>
        </table>
        <input type="hidden" name="scenario" value="<?php echo $scenario; ?>"/>
        <input type="hidden" name="version" value="<?php echo $aDatasetFile['version']; ?>"/>
        <input type="hidden" name="application" value="<?php echo $aDatasetFile['application']; ?>"/>
        <input type="hidden" name="dbname" value="<?php echo $aDatasetFile['name']; ?>"/>
    </div>
    <div class="tablediv">
            <button name="btn_data_load">load data into database "<?php echo $aDatasetFile['name']; ?>"</button>
            <button name="btn_data_upgrade">upgrade database "<?php echo $aDatasetFile['name']; ?>"</button>
            <button name="btn_data_drop">drop database "<?php echo $aDatasetFile['name']; ?>"</button>

    </div>
   <div class="tablediv">
            <button name="btn_data_integ">run an integrity check on database "<?php echo $aDatasetFile['name']; ?>" against =></button>
            <select name="compare_version">
                <option value="548" <?php echo ($aDatasetFile['version']==548 ? 'selected' : '')?>>schema 548 (2.5.50-dev)</option>
                <option value="515" <?php echo ($aDatasetFile['version']==515 ? 'selected' : '')?>>schema 515 (2.3.32-beta >> 2.4.0)</option>
                <option value="129.34" <?php echo ($aDatasetFile['version']==129.34 ? 'selected' : '')?>>schema 129.34 (2.3.34-beta)</option>
                <option value="500" <?php echo ($aDatasetFile['version']==500 ? 'selected' : '')?>>schema 500 (2.3.31-pr3)</option>
                <option value="300" <?php echo ($aDatasetFile['version']==300 ? 'selected' : '')?>>schema 300 (2.1.29-rc)</option>
                <option value="099" <?php echo ($aDatasetFile['version']==099 ? 'selected' : '')?>>schema 099 (2.0.11-pr1)</option>
            </select>
    </div>
    <div class="tablediv">
        <button name="btn_data_dump">dump database "<?php echo $aDatasetFile['name']; ?>" to xml excluding </button>
        backups<input type="checkbox" checked name="exclude[bak]" value="z_"/>
        data raw<input type="checkbox" checked name="exclude[raw]" value="data_raw_"/>
        data summary<input type="checkbox" checked name="exclude[sum]" value="data_summary_"/>
        data intermediary<input type="checkbox" checked name="exclude[int]" value="data_intermediate_"/>
        logs<input type="checkbox" name="exclude[log]" value="log_maintenance_"/>
        actions<input type="checkbox" checked name="exclude[act]" value="_action"/>
        audit<input type="checkbox" checked name="exclude[img]" value="images"/>
        images<input type="checkbox" checked name="exclude[aud]" value="audit"/>
   </div>

    <div class="tablediv">
            <button name="btn_action_run">run simulation "<?php echo $aDatasetFile['name']; ?>"</button>
            <button name="btn_action_delete">delete simulation "<?php echo $aDatasetFile['name']; ?>"</button>
    </div>
    <?php
    if (count($aTasks)>0)
    {
    ?>
        <div class="tablediv">
            <button name="btn_integ_exec" value="<?php echo $file_changes; ?>">execute the selected tasks using <?php echo $file_changes; ?></button>
            <input name="changes_version" type="hidden" value="<?php echo $aDatasetFile['version']; ?>" />
        </div>
        <table class="tablebody">
        <tr>
        <td class="tablebody" style="width:50%">
    <?php
    }
    if (count($aTasksConstructive)>0)
    {
        $tickAll = true;
    ?>
    <div class="tablediv">
        <table class="tablebody">
            <tr><th colspan="4">Constructive Changes <?php echo $aDatasetFile['version'].' => '.$compare_version; ?></th></tr>
            <tr>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Add Tables</th></tr>
                        <?php
                            $aTasks = $aTasksConstructive['tables']['add'];
                            $fieldname = 'constructive[tables][add][]';
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Add Fields</th></tr>
                        <?php
                            $aTasks = $aTasksConstructive['fields']['add'];
                            $fieldname = 'constructive[fields][add][]';
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Alter Fields</th></tr>
                        <?php
                            $aTasks = $aTasksConstructive['fields']['change'];
                            $fieldname = 'constructive[fields][change][]';
                            //$showCargo = true;
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Remove Indexes</th></tr>
                        <?php
                            $aTasks = $aTasksConstructive['indexes']['remove'];
                            $fieldname = 'constructive[indexes][remove][]';
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Add Indexes</th></tr>
                        <?php
                            $aTasks = $aTasksConstructive['indexes']['add'];
                            $fieldname = 'constructive[indexes][add][]';
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
            </tr>
        </table>
        </td>
        <tr>
        <td class="tablebody" style="width:50%">
    <?php
    }
    if (count($aTasksDestructive)>0)
    {
        $tickAll = false;
    ?>
        <table class="tablebody">
            <tr><th colspan="4">Destructive Changes <?php echo $aDatasetFile['version'].' => '.$compare_version; ?></th></tr>
            <tr>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Remove Tables</th></tr>
                        <?php
                            $aTasks = $aTasksDestructive['tables']['remove'];
                            $fieldname = 'destructive[tables][remove][]';
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
                <td style="vertical-align:top;">
                    <table class="tablebody">
                        <tr><th colspan="2">Remove Fields</th></tr>
                        <?php
                            $aTasks = $aTasksDestructive['fields']['remove'];
                            $fieldname = 'destructive[fields][remove][]';
                            include 'templates/integtaskssection.html';
                        ?>
                    </table>
                </td>
            </tr>
        </table>
        </td>
        </tr>
        </table>
    </div>
    <?php
    }
    if (count($aMessages)>0)
    {
    ?>
    <div class="tablediv">
            <!--img id="img_expand_debugdiv" src="../../img/triangle-d.gif" alt="click to view debug info" onclick="xajax_expandTable('debugdiv');"/>
            <img id="img_collapse_debugdiv" src="../../img/triangle-u.gif" style="display:none" alt="click to hide debug info" onclick="xajax_collapseTable('debugdiv');"/-->
    <table id="debugdiv">
    <tr><th>debug info
    </th></tr>
    <?php
        foreach ($aMessages AS $k => $msg)
        {
            echo '<tr><td>'.$msg.'</td></tr>';
        }
    ?>
    </table>
    </div>
    <?php
    }
    ?>

 </form>
  </body>
</html>